import { reactive } from "vue";
import type { FormRules } from "element-plus";

/** 自定义表单规则校验 */
export const formRules = reactive(<FormRules>{
  name: [{ required: true, message: "物料名称为必填项", trigger: "blur" }],
  code: [{ required: true, message: "物料编码必填项", trigger: "blur" }],
  status: [{ required: true, message: "状态为必填项", trigger: "change" }],
  materialUnitId: [{ required: true, message: "物料单位为必填项", trigger: "change" }],
  materialCategoryId: [{ required: true, message: "物料类型为必填项", trigger: "change" }],
  stockInTactic: [{ required: true, message: "入库策略为必填项", trigger: "change" }],
  stockOutTactic: [{ required: true, message: "出库策略为必填项", trigger: "change" }],
  warehouseArr: [{ required: true, message: "存放地址为必填项", trigger: "change" }],
  // expireType: [{ required: true, message: "过期类型为必填项", trigger: "change" }],
  expireDate: [{ required: true, message: "过期时间为必填项", trigger: "change" }],
  produceDate: [{ required: true, message: "生产日期为必填项", trigger: "change" }],
  expireDateNum: [{ required: true, message: "保质期为必填项", trigger: "change" }],
  stockWarnMin: [{ required: true, message: "最小库存数为必填项", trigger: "change" }],
  stockWarnMax: [{ required: true, message: "最大库存数为必填项", trigger: "change" }],
});
